package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HousecholdMapper;
import com.ruoyi.system.domain.Housechold;
import com.ruoyi.system.service.IHousecholdService;
import com.ruoyi.common.core.text.Convert;

/**
 * 户口立户Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-15
 */
@Service
public class HousecholdServiceImpl implements IHousecholdService 
{
    @Autowired
    private HousecholdMapper housecholdMapper;

    /**
     * 查询户口立户
     * 
     * @param id 户口立户主键
     * @return 户口立户
     */
    @Override
    public Housechold selectHousecholdById(Long id)
    {
        return housecholdMapper.selectHousecholdById(id);
    }

    /**
     * 查询户口立户列表
     * 
     * @param housechold 户口立户
     * @return 户口立户
     */
    @Override
    public List<Housechold> selectHousecholdList(Housechold housechold)
    {
        return housecholdMapper.selectHousecholdList(housechold);
    }

    /**
     * 新增户口立户
     * 
     * @param housechold 户口立户
     * @return 结果
     */
    @Override
    public int insertHousechold(Housechold housechold)
    {
        housechold.setCreateTime(DateUtils.getNowDate());
        return housecholdMapper.insertHousechold(housechold);
    }

    /**
     * 修改户口立户
     * 
     * @param housechold 户口立户
     * @return 结果
     */
    @Override
    public int updateHousechold(Housechold housechold)
    {
        return housecholdMapper.updateHousechold(housechold);
    }

    /**
     * 批量删除户口立户
     * 
     * @param ids 需要删除的户口立户主键
     * @return 结果
     */
    @Override
    public int deleteHousecholdByIds(String ids)
    {
        return housecholdMapper.deleteHousecholdByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除户口立户信息
     * 
     * @param id 户口立户主键
     * @return 结果
     */
    @Override
    public int deleteHousecholdById(Long id)
    {
        return housecholdMapper.deleteHousecholdById(id);
    }
}
